Optimal. Leaf size=142 \[ -\frac {1}{4} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erf}\left (\frac {\sqrt [4]{-1} (2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erfi}\left (\frac {\sqrt [4]{-1} (2 i f x-b \log (f))}{2 \sqrt {f}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 142, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {4561, 2325,
2266, 2235, 2236} \begin {gather*} -\frac {1}{4} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{\frac {1}{4} i \left (\frac {b^2 \log ^2(f)}{f}+4 d\right )} \text {Erf}\left (\frac {\sqrt [4]{-1} (b \log (f)+2 i f x)}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{-\frac {1}{4} i \left (\frac {b^2 \log ^2(f)}{f}+4 d\right )} \text {Erfi}\left (\frac {\sqrt [4]{-1} (-b \log (f)+2 i f x)}{2 \sqrt {f}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 2325
Rule 4561
Rubi steps
\begin {align*} \int f^{a+b x} \cos \left (d+f x^2\right ) \, dx &=\int \left (\frac {1}{2} e^{-i d-i f x^2} f^{a+b x}+\frac {1}{2} e^{i d+i f x^2} f^{a+b x}\right ) \, dx\\ &=\frac {1}{2} \int e^{-i d-i f x^2} f^{a+b x} \, dx+\frac {1}{2} \int e^{i d+i f x^2} f^{a+b x} \, dx\\ &=\frac {1}{2} \int e^{-i d-i f x^2+a \log (f)+b x \log (f)} \, dx+\frac {1}{2} \int e^{i d+i f x^2+a \log (f)+b x \log (f)} \, dx\\ &=\frac {1}{2} \left (e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^a\right ) \int e^{\frac {i (-2 i f x+b \log (f))^2}{4 f}} \, dx+\frac {1}{2} \left (e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^a\right ) \int e^{-\frac {i (2 i f x+b \log (f))^2}{4 f}} \, dx\\ &=-\frac {1}{4} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erf}\left (\frac {\sqrt [4]{-1} (2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt [4]{-1} (2 i f x-b \log (f))}{2 \sqrt {f}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.25, size = 133, normalized size = 0.94 \begin {gather*} \frac {1}{4} \sqrt [4]{-1} e^{-\frac {i b^2 \log ^2(f)}{4 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \left (-\text {Erfi}\left (\frac {(-1)^{3/4} (2 f x+i b \log (f))}{2 \sqrt {f}}\right ) (\cos (d)-i \sin (d))+e^{\frac {i b^2 \log ^2(f)}{2 f}} \text {Erfi}\left (\frac {\sqrt [4]{-1} (2 f x-i b \log (f))}{2 \sqrt {f}}\right ) (-i \cos (d)+\sin (d))\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 114, normalized size = 0.80
method | result | size |
risch | \(-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {i \left (\ln \left (f \right )^{2} b^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {i f}}\right )}{4 \sqrt {i f}}-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {i \left (\ln \left (f \right )^{2} b^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {-i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {-i f}}\right )}{4 \sqrt {-i f}}\) | \(114\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 147, normalized size = 1.04 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right ) + \left (i + 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {2 i \, f x - b \log \left (f\right )}{2 \, \sqrt {i \, f}}\right ) + {\left (\left (i + 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right ) + \left (i - 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {2 i \, f x + b \log \left (f\right )}{2 \, \sqrt {-i \, f}}\right )\right )}}{8 \, \sqrt {f}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 265 vs. \(2 (98) = 196\).
time = 2.07, size = 265, normalized size = 1.87 \begin {gather*} \frac {\sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) - 4 i \, d f}{4 \, f}\right )} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) + 4 i \, d f}{4 \, f}\right )} \operatorname {C}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) - 4 i \, d f}{4 \, f}\right )} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) + 4 i \, d f}{4 \, f}\right )} \operatorname {S}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x} \cos {\left (d + f x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 300 vs. \(2 (98) = 196\).
time = 0.46, size = 300, normalized size = 2.11 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x - \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} - \frac {i \, \pi ^{2} b^{2}}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} + \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) + i \, d\right )}}{4 \, {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} - \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x + \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (-\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} + \frac {i \, \pi ^{2} b^{2}}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} - \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) - i \, d\right )}}{4 \, {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int f^{a+b\,x}\,\cos \left (f\,x^2+d\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________